package commons.entity;

import com.melloware.jintellitype.JIntellitype;
import commons.util.GameUtil;
import fgoScript.entity.BaseZButton;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;

import java.awt.event.KeyEvent;

public class CommonModules {
    private static final Logger LOGGER = LogManager.getLogger(CommonModules.class);

    public BaseZButton getMoveToXYBt() {
        BaseZButton MoveToXYBt = new BaseZButton(null, 0,"移动(S+W)",JIntellitype.MOD_SHIFT, (int) 'W',false, false, BaseZButton.pink) {
            private static final long serialVersionUID = -7389326247723792445L;
            @Override
            public void runMethod() {
                try {
                    GameUtil.moveToPositionByClipBoard();
                } catch (Exception e) {
                    LOGGER.error(e.getMessage(),e);
                }
            }
        };
        return MoveToXYBt;

    }
    public BaseZButton getXYBt() {
        BaseZButton XYBt = new BaseZButton(null, 0,"获取鼠标位置颜色(Shift+E)",JIntellitype.MOD_SHIFT, (int) 'E',false, false, BaseZButton.pink) {
            private static final long serialVersionUID = -7389326247723796445L;
            @Override
            public void runMethod() {
                GameUtil.showPositionAndColor();
            }
        };
        return XYBt;
    }
    public BaseZButton getPauseBtn() {
        BaseZButton pauseBtn = new BaseZButton(null, 0, "暂停", JIntellitype.MOD_ALT, KeyEvent.VK_9, true, true, BaseZButton.pink) {
            private static final long serialVersionUID = -7491221341872701498L;
            @Override
            public void runMethod() {
                GameUtil.waitOrContinue(this);
            }
        };
        return pauseBtn;
    }

}
